function retval = smoothflat (X)
  if (nargin != 1)
    usage ("smoothflat (X)");
  endif

  [xr, xc] = size(X);

  n = xr;
  c = xc;

  if (isvector(X))
   n = length(X);
   c = 1;
   X = reshape(X, n, 1);
  endif

 W = gaussian(31, 0.15);
 W = W/sum(W);
  retval = fftfilt (W, X);
  retval = [zeros(15,c); retval(31:n,:); zeros(15,c);];
  retval = reshape(retval, xr, xc);
endfunction
